import request from '@/utils/request'

//获取设备列表
export const deviceListApi = () => {
  return request({
    url: '/device/list',
    method: 'GET',
    params: {}
  })
}

//获取设备编号
export const getdeviceSerializableApi = (sessionId) =>{
  return request({
    url: '/device/getDeviceSerializable',
    method: 'GET',
    params: {sessionId}
  })
}

//开始采集
export const startCollectApi=(deviceSerializable) =>{
  return request({
    url: '/device/startCollect',
    method: 'GET',
    params: {deviceSerializable}
  })
}

//停止采集
export const stopCollectApi=(sessionId)=>{
  return request({
    url: '/device/stopCollect',
    method: 'GET',
    params: {sessionId}
  })
}


//获取放大倍数
export const getMagnificationApi=(sessionId) =>{
  return request({
    url: '/device/getMagnification',
    method: 'GET',
    params: {sessionId}
  })
}

//设置放大倍数
export const setMagnificationApi=(sessionId,a,b) =>{
  return request({
    url: '/device/setMagnification',
    method: 'GET',
    params: {sessionId,a,b}
  })
}

//获取采样频率
export const getSamplingFrequencyApi=(sessionId) =>{
  return request({
    url: '/device/getSamplingFrequencyApi',
    method: 'GET',
    params: {sessionId}
  })
}

export const setSamplingFrequencyApi=(sessionId,samplingFrequency) =>{
  return request({
    url: '/device/setSamplingFrequencyApi',
    method: 'GET',
    params: {sessionId,samplingFrequency}
  })
}
